﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView view = (DataView)SqlDataSource1.Select(new DataSourceSelectArguments());
        if (view != null && view.Table.Rows.Count > 0)
        {
            Session["UserID"] = view.Table.Rows[0]["id"];
            Response.Redirect("/");
        }
        else
        {
            Session.Remove("UserID");
            Label1.Visible = true;

        }
    }
}